import { createRouter, createWebHistory } from "vue-router";
import HomeView from "../views/HomeView.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/home",
      name: "home",
      component: HomeView,
      redirect: "/home/blog",
      children: [
        {
          path: "blog",
          name: "博客",
          component: () => import("../views/pages/BlogView.vue"),
        },
        {
          path: "announcement",
          name: "公告",
          component: () => import("../views/pages/AnnouncementView.vue"),
        },
        {
          path: "categories",
          name: "分类",
          component: () => import("../views/pages/CategoriesView.vue"),
        },
        {
          path: "message-board",
          name: "留言板",
          component: () => import("../views/pages/MessageBoardView.vue"),
        },
      ],
    },
  ],
});

export default router;
